package com.example.literaturesystem.dao.category;

import java.util.List;

import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import com.example.literaturesystem.domain.base.BaseModel;
import com.example.literaturesystem.domain.category.Category;

/**
*@author LMR
*@data 2018年1月30日下午8:23:34
*/
@Repository("CategoryDao")
public interface ICategoryDao {

	 @Select("<script>SELECT  DISTINCT categoryName FROM subjectCategory WHERE 1=1</script>")
	 List<Category> queryCategory();
	 
	 
	 @Select("<script>SELECT  DISTINCT major FROM subjectCategory WHERE 1=1\n" +
	            "<if test=\"categoryName!=null and categoryName!=''\">\n" +
	            "AND categoryName=#{categoryName}\n" +
	            "</if>"  +
	            "</script>")
	 List<Category> queryMajor(BaseModel model);
}
